<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function onlineUser(){
		window.location.href = "./systemService.do?action=onlineUser";
		window.location.target = "main";
	}
	
	
	function advancedQueryDialog(){
		var url = "./systemService.do?action=preQuerySystemLog";
		var dlgParam = "dialogHeight:360px;dialogWidth:450px;dialogTop:300px;dialogLeft:400px;status:no;help:no;scrollbars:yes;";
		var rt = window.showModalDialog(url,"",dlgParam);
		if(rt != undefined){			
			//根据从子窗口得到的值，从中提取用户名称、模块名称id、开始日期、结束日期
			var userName = "";
			var parentFunctionId = "";
			var startDate = "";
			var endDate = "";
			var tStr = rt.split(",");
			//if(tStr[0] != 0 && tStr[1] != 0){
				userName = tStr[0];
				if(tStr[1] != "" && tStr[1] != "0"){
					parentFunctionId = tStr[1];
				}
				startDate = tStr[2];
				endDate = tStr[3];
			//}
			document.getElementById("userName").value = userName;										
			document.getElementById("parentFunctionId").value = parentFunctionId;
			document.getElementById("startDate").value = startDate;
			document.getElementById("endDate").value = endDate;
			
			if(userName != "" || (parentFunctionId != "" && parentFunctionId != "0") || (startDate != "" && endDate != "")){
				document.systemServiceForm.action = "./systemService.do";
				document.systemServiceForm.target = "main";
				document.systemServiceForm.submit();
			}
		}
	}
	
	function pageCustomer(flag){
		document.systemServiceForm.action = "./systemService.do?action=display&flag="+flag;
		document.systemServiceForm.target = "main";
		document.systemServiceForm.submit();
	}
-->
</script>
</head>
<body>
<form name="systemServiceForm" action="" method="post">
	<table class="table_frame">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab" colspan="2">系统日志</td>
					</tr>
					<tr>
						<td valign="bottom" class="a_tools" style="padding-left: 3px;">
							<a class="asearch" href="javascript:advancedQueryDialog();" title="高级查询" hidefocus="true">高级查询</a>
							|
							<a href="javascript:onlineUser();" title="查看在线用户" hidefocus="true">在线用户</a>
							<input id="userName" name="userName" type="hidden" value="${modelLog.userName}"/>
							<input id="parentFunctionId" name="parentFunctionId" type="hidden" value="${modelLog.parentFunctionId}"/>
							<input id="startDate" name="startDate" type="hidden" value="${modelLog.startDate}"/>
							<input id="endDate" name="endDate" type="hidden" value="<fmt:formatDate value='${modelLog.endDate}' pattern='yyyy-MM-dd'/>"/>
						</td>
						<td></td>
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="table_title2">
					<tr>
						<td class="title_lab">系统日志列表</td>
					</tr>
					<tr>
						<td>
							<table class="table">
								<tr>
									<td valign="top">
										<table class="table_style">
											<tr>
												<td class="title" width="8"></td>
												<td class="title" width="12%">用户名称</td>
												<td class="title" width="">操作模块</td>
												<td class="title" width="12%">操作名称</td>
												<td class="title" width="20%">操作时间</td>
											</tr>
											<c:forEach var="modelLog" items="${modelLogs}">
											<tr onmouseover="onmousemoveChange(this,'img${modelLog.id}')" onmouseout="onmouseoutChange(this,'img${modelLog.id}')">
												<td height="16" width="8" align="right"><img id="img${modelLog.id}" src="./images/table_sign2.bmp"></td>
												<td>${modelLog.userName}</td>
												<td>
												<c:choose>
													<c:when test="${modelLog.functionId == 51}">客户管理 / 公海客户</c:when>
													<c:when test="${modelLog.functionId == 52}">客户管理 / 客户资料</c:when>
													<c:when test="${modelLog.functionId == 53}">客户管理 / 共享客户</c:when>
													<c:when test="${modelLog.functionId == 54}">客户管理 / 联系人资料</c:when>
													<c:when test="${modelLog.functionId == 55}">客户管理 / 签约客户</c:when>
													<c:when test="${modelLog.functionId == 56}">客户管理 / 分析报表</c:when>
													<c:when test="${modelLog.functionId == 57}">客户管理 / 回收站</c:when>
													
													<c:when test="${modelLog.functionId == 61}">销售过程 / 销售漏斗</c:when>
													<c:when test="${modelLog.functionId == 62}">销售过程 / 销售日志</c:when>
													<c:when test="${modelLog.functionId == 63}">销售过程 / 日程安排</c:when>
													<c:when test="${modelLog.functionId == 64}">销售过程 / 分析报表</c:when>
													
													<c:when test="${modelLog.functionId == 71}">营销财务 / 审核销售合同</c:when>
													<c:when test="${modelLog.functionId == 72}">营销财务 / 审核销售费用</c:when>
													<c:when test="${modelLog.functionId == 73}">营销财务 / 费用管理</c:when>
													<c:when test="${modelLog.functionId == 74}">营销财务 / 销售合同</c:when>
													<c:when test="${modelLog.functionId == 75}">营销财务 / 应收帐款</c:when>
													<c:when test="${modelLog.functionId == 76}">营销财务 / 分析报表</c:when>
													
													<c:when test="${modelLog.functionId == 81}">团队管理 / 员工管理</c:when>
													<c:when test="${modelLog.functionId == 82}">团队管理 / 异动客户</c:when>
													<c:when test="${modelLog.functionId == 83}">团队管理 / 指派客户</c:when>
													<c:when test="${modelLog.functionId == 84}">团队管理 / 报备管理</c:when>
													<c:when test="${modelLog.functionId == 85}">团队管理 / 分析报表</c:when>
												</c:choose>
												</td>
												<td>
												<c:choose>
													<c:when test="${modelLog.functionOperate == '1'}">新增</c:when>
													<c:when test="${modelLog.functionOperate == '2'}">修改</c:when>
													<c:when test="${modelLog.functionOperate == '3'}">删除</c:when>
													<c:when test="${modelLog.functionOperate == '4'}">丢弃</c:when>
													<c:when test="${modelLog.functionOperate == '5'}">导入</c:when>
													<c:when test="${modelLog.functionOperate == '6'}">保护</c:when>
													<c:when test="${modelLog.functionOperate == '7'}">恢复</c:when>
													<c:when test="${modelLog.functionOperate == '8'}">指定</c:when>
													<c:when test="${modelLog.functionOperate == '9'}">转移</c:when>
													<c:when test="${modelLog.functionOperate == '10'}">共享</c:when>
													<c:when test="${modelLog.functionOperate == '11'}">审核</c:when>
													<c:when test="${modelLog.functionOperate == '12'}">退回</c:when>
													<c:when test="${modelLog.functionOperate == '13'}">终止</c:when>
													<c:when test="${modelLog.functionOperate == '14'}">开票</c:when>
													<c:when test="${modelLog.functionOperate == '15'}">撤消</c:when>
													<c:when test="${modelLog.functionOperate == '16'}">合并</c:when>
												</c:choose>
												</td>
												<td><fmt:formatDate value="${modelLog.logDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
											</tr>
											</c:forEach>
											<c:if test="${empty modelLogs}">
											<tr><td class="" colspan="5">对不起，没有符合条件的内容！</td></tr>
											</c:if>
										</table>
									</td>
								</tr>
								<tr>
									<td>
										<!-- page -->
										<table class="table_page">
											<tr>
												<td class="a_tools">
													${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>&nbsp;&nbsp;
													<fmt:message key='common.page.totalPage'/>&nbsp;${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;&nbsp;
													<fmt:message key='common.page.current'/>&nbsp;${currentPage}&nbsp;<fmt:message key='common.page'/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													<a href="javascript:pageCustomer(1);" target="main" hidefocus="true"><fmt:message key='common.page.first'/></a>&nbsp;&nbsp;
													<a href="javascript:pageCustomer(2);" target="main" hidefocus="true"><fmt:message key='common.page.previous'/></a>&nbsp;&nbsp;
													<a href="javascript:pageCustomer(3);" target="main" hidefocus="true"><fmt:message key='common.page.next'/></a>&nbsp;&nbsp;
													<a href="javascript:pageCustomer(4);" target="main" hidefocus="true"><fmt:message key='common.page.last'/></a>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</body>
</html>